package com.etc.zzsys.service.impl;

import java.util.List;

import com.etc.zzsys.dao.UserDao;
import com.etc.zzsys.dao.impl.UserDaoImpl;
import com.etc.zzsys.entity.Question;
import com.etc.zzsys.entity.User;
import com.etc.zzsys.service.UserService;
import com.etc.zzsys.util.PageData;

public class UserServiceImpl implements UserService {
	private UserDao userDao = new UserDaoImpl();

	@Override
	public List<User> getUsers() {
		return userDao.getUsers();
	}
	
	@Override
	public boolean addUser(User user) {
		
		return userDao.addUser(user);
	}

	@Override
	public boolean delUser(int userId) {
		// TODO Auto-generated method stub
		return userDao.delUser(userId);
	}

	@Override
	public boolean updateUser(User u) {
		// TODO Auto-generated method stub
		return userDao.updateUser(u);
	}

	@Override
	public User checkLogin(String username, String pwd) {
		// TODO Auto-generated method stub
		return userDao.login(username, pwd);
	}

	@Override
	public PageData<User> queryQuestionByPage(int page, int pageSize, String key) {
		// TODO Auto-generated method stub
		return userDao.queryQuestionByPage(page, pageSize, key);
	}

	@Override
	public User getUserByName(String username) {
		// TODO Auto-generated method stub
		return userDao.getUserByName(username);
	}

	public boolean regist(User u) {
		// TODO Auto-generated method stub
		return userDao.regist(u);
	}



	
}
